POV-Ray : Newsgroups : povray.beta-test : Strange spline bug : Strange spline bug Server Time
4 Nov 2024 13:59:02 EST (-0500)
  Strange spline bug  
From: Rune
Date: 28 Sep 2001 02:50:48
Message: <3bb41dc8@news.povray.org>
The code below seems to give a consistent result for all values of V except
the three integers -3, -2, and -1. Setting V to one of those values makes
the spline go nuts.

#declare V = -3;
camera {location 8*y look_at 0 translate <0,0,2>}
light_source {1000*y, color 1}
plane {y, 0 pigment {checker color rgb 1.0, color rgb 0.9}}
#declare Spline =
spline {
   cubic_spline
    0+V, <-2,0,0>,
    1+V, < 0,0,0>, // red
    2+V, < 2,0,0>,
    3+V, < 4,0,2>,
    9+V, <-4,0,2>,
   10+V, <-2,0,0>,
   11+V, < 0,0,0>, // red
   12+V, < 2,0,0>,
}
#declare C = 0+V;
#while (C<=12+V)
   #declare Value = C;
   #if (C>1+V&C<11+V) #declare Color = <0,0,1>; #end
   #if (C<1+V|C>11+V) #declare Color = <0,1,0>; #end
   #if (C=1+V|C=11+V) #declare Color = <1,0,0>; #end
   sphere {Spline(Value), 0.2 pigment {color Color}}
   #declare C = C+0.2;
#end

Rune
--
3D images and anims, include files, tutorials and more:
Rune's World:    http://rsj.mobilixnet.dk (updated June 26)
POV-Ray Users:   http://rsj.mobilixnet.dk/povrayusers/
POV-Ray Webring: http://webring.povray.co.uk


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.